using System;
using System.Data;
using System.Collections.Generic;
using ADOBase;
namespace eTMS.DAO{
	/********************************BEGIN SinhVienLopTinChiDAO****************************************/
	///<summary>
	/// <para>Author: Auto generated class by CSharp Code Generator v2.0</para>
	/// <para>Date:26/10/2011 34:05:09</para>
	/// <para>Class Name: SinhVienLopTinChiDAO</para>
	/// <para>Description: Class access to table SinhVienLopTinChi in database. Coder should'nt code here.</para>
	///</summary>

	
	public partial class SinhVienLopTinChiDAO : DAOBase<SinhVienLopTinChiEntity>{


		#region Select functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectOneCommand</para>
		/// <para>Input: SinhVienLopTinChi_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectOneCommand(int SinhVienLopTinChi_ID){
			string strSQL="SELECT  [SinhVienLopTinChi_ID],[LopTinChi_ID],[SinhVien_ID],[TrangThai],[NgayDangKy] FROM [SinhVienLopTinChi]  WHERE [SinhVienLopTinChi].[SinhVienLopTinChi_ID]=@SinhVienLopTinChi_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@SinhVienLopTinChi_ID",SinhVienLopTinChi_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectOne</para>
		/// <para>Input: SinhVienLopTinChi_ID</para>
		/// <para>Output: SinhVienLopTinChiEntity</para>
		///</summary>
		public SinhVienLopTinChiEntity SelectOne(int SinhVienLopTinChi_ID){
			IDbCommand cmd=this.CreateSelectOneCommand(SinhVienLopTinChi_ID);
			return this.Select(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllCommand(){
			string strSQL="SELECT  [SinhVienLopTinChi_ID],[LopTinChi_ID],[SinhVien_ID],[TrangThai],[NgayDangKy] FROM [SinhVienLopTinChi] ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllByKeyCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyCommand(string ColumnName,object Value){
			string strSQL="SELECT  [SinhVienLopTinChi_ID],[LopTinChi_ID],[SinhVien_ID],[TrangThai],[NgayDangKy] FROM [SinhVienLopTinChi]  WHERE [SinhVienLopTinChi].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of SinhVienLopTinChiEntity</para>
		///</summary>
		public List<SinhVienLopTinChiEntity> SelectAll(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAllDS</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDS(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectDS(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllFilterCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllFilterCommand(string strFilter){
			string strSQL="SELECT  [SinhVienLopTinChi_ID],[LopTinChi_ID],[SinhVien_ID],[TrangThai],[NgayDangKy] FROM [SinhVienLopTinChi]  WHERE "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllByKeyFilterCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyFilterCommand(string strFilter,string ColumnName,object Value){
			string strSQL="SELECT  [SinhVienLopTinChi_ID],[LopTinChi_ID],[SinhVien_ID],[TrangThai],[NgayDangKy] FROM [SinhVienLopTinChi]  WHERE [SinhVienLopTinChi].["+ColumnName+"]=@ColumnName AND "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of SinhVienLopTinChiEntity</para>
		///</summary>
		public List<SinhVienLopTinChiEntity> SelectAllFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAllDSFilter</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDSFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectDS(cmd);
		}
		#endregion

		#region Insert functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateInsertCommand</para>
		/// <para>Input: SinhVienLopTinChiEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateInsertCommand(SinhVienLopTinChiEntity o){
			string strSQL="INSERT INTO [SinhVienLopTinChi]([LopTinChi_ID],[SinhVien_ID],[TrangThai],[NgayDangKy]) VALUES  (@LopTinChi_ID,@SinhVien_ID,@TrangThai,@NgayDangKy);SELECT  @@IDENTITY";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullLopTinChi_ID)
				this.CreateCommandParameter(cmd,"@LopTinChi_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@LopTinChi_ID",o.LopTinChi_ID);

			if(o.IsNullSinhVien_ID)
				this.CreateCommandParameter(cmd,"@SinhVien_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SinhVien_ID",o.SinhVien_ID);

			if(o.IsNullTrangThai)
				this.CreateCommandParameter(cmd,"@TrangThai",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TrangThai",o.TrangThai);

			if(o.IsNullNgayDangKy)
				this.CreateCommandParameter(cmd,"@NgayDangKy",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@NgayDangKy",o.NgayDangKy);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: Save</para>
		/// <para>Input: SinhVienLopTinChiEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Save(SinhVienLopTinChiEntity o){
			bool result=false;
			IDbCommand cmd=this.CreateInsertCommand(o);
			object id=this.ExecuteScalar(cmd,ref result);
			cmd.Dispose();
			try{
				o.SinhVienLopTinChi_ID=int.Parse(Convert.ToString(id));
			}
			catch{}
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SaveList</para>
		/// <para>Input: List of SinhVienLopTinChiEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void SaveList(List<SinhVienLopTinChiEntity>list){
			foreach(SinhVienLopTinChiEntity o in list){
				try{
					this.Save(o);
				}
				catch{
				}
			}
		}
		#endregion

		#region Update functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateUpdateCommand</para>
		/// <para>Input: SinhVienLopTinChiEntity</para>
		/// <para>Output: </para>
		///</summary>
		protected IDbCommand CreateUpdateCommand(SinhVienLopTinChiEntity o){
			string strSQL="UPDATE  [SinhVienLopTinChi] SET [SinhVienLopTinChi].[LopTinChi_ID]=@LopTinChi_ID,[SinhVienLopTinChi].[SinhVien_ID]=@SinhVien_ID,[SinhVienLopTinChi].[TrangThai]=@TrangThai,[SinhVienLopTinChi].[NgayDangKy]=@NgayDangKy WHERE [SinhVienLopTinChi].[SinhVienLopTinChi_ID]=@SinhVienLopTinChi_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullSinhVienLopTinChi_ID)
				this.CreateCommandParameter(cmd,"@SinhVienLopTinChi_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SinhVienLopTinChi_ID",o.SinhVienLopTinChi_ID);

			if(o.IsNullLopTinChi_ID)
				this.CreateCommandParameter(cmd,"@LopTinChi_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@LopTinChi_ID",o.LopTinChi_ID);

			if(o.IsNullSinhVien_ID)
				this.CreateCommandParameter(cmd,"@SinhVien_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SinhVien_ID",o.SinhVien_ID);

			if(o.IsNullTrangThai)
				this.CreateCommandParameter(cmd,"@TrangThai",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TrangThai",o.TrangThai);

			if(o.IsNullNgayDangKy)
				this.CreateCommandParameter(cmd,"@NgayDangKy",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@NgayDangKy",o.NgayDangKy);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateUpdateFieldCommand</para>
		/// <para>Input: ColumnName,ColumnValue,SinhVienLopTinChi_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateUpdateFieldCommand(string ColumnName,object Value,int SinhVienLopTinChi_ID){
			string strSQL="UPDATE  [SinhVienLopTinChi] SET [SinhVienLopTinChi].["+ColumnName+"]=@ColumnName WHERE [SinhVienLopTinChi].[SinhVienLopTinChi_ID]=@SinhVienLopTinChi_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@SinhVienLopTinChi_ID",SinhVienLopTinChi_ID);



			this.CreateCommandParameter(cmd,"@ColumnName",Value);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: Update</para>
		/// <para>Input: SinhVienLopTinChiEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Update(SinhVienLopTinChiEntity o){
			IDbCommand cmd=this.CreateUpdateCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateList</para>
		/// <para>Input: List of SinhVienLopTinChiEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void UpdateList(List<SinhVienLopTinChiEntity>list){
			foreach(SinhVienLopTinChiEntity o in list){
				try{
					this.Update(o);
				}
				catch{
				}
			}
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateLopTinChi_ID</para>
		/// <para>Input: NewLopTinChi_ID,SinhVienLopTinChi_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateLopTinChi_ID(int NewLopTinChi_ID,int SinhVienLopTinChi_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("LopTinChi_ID",NewLopTinChi_ID,SinhVienLopTinChi_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateSinhVien_ID</para>
		/// <para>Input: NewSinhVien_ID,SinhVienLopTinChi_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateSinhVien_ID(int NewSinhVien_ID,int SinhVienLopTinChi_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("SinhVien_ID",NewSinhVien_ID,SinhVienLopTinChi_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateTrangThai</para>
		/// <para>Input: NewTrangThai,SinhVienLopTinChi_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateTrangThai(Byte NewTrangThai,int SinhVienLopTinChi_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("TrangThai",NewTrangThai,SinhVienLopTinChi_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateNgayDangKy</para>
		/// <para>Input: NewNgayDangKy,SinhVienLopTinChi_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateNgayDangKy(DateTime NewNgayDangKy,int SinhVienLopTinChi_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("NgayDangKy",NewNgayDangKy,SinhVienLopTinChi_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Delete functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteAllCommand(){
			string strSQL="DELETE   FROM [SinhVienLopTinChi]  ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteCommand</para>
		/// <para>Input: SinhVienLopTinChiEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteCommand(SinhVienLopTinChiEntity o){
			string strSQL="DELETE   FROM [SinhVienLopTinChi]   WHERE [SinhVienLopTinChi].[SinhVienLopTinChi_ID]=@SinhVienLopTinChi_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullSinhVienLopTinChi_ID)
				this.CreateCommandParameter(cmd,"@SinhVienLopTinChi_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SinhVienLopTinChi_ID",o.SinhVienLopTinChi_ID);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteAll</para>
		/// <para>Input: </para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteAll(){
			IDbCommand cmd=this.CreateDeleteAllCommand();
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateDeleteByPrimaryKeyCommand</para>
		/// <para>Input: SinhVienLopTinChi_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByPrimaryKeyCommand(int SinhVienLopTinChi_ID){
			string strSQL="DELETE   FROM [SinhVienLopTinChi]   WHERE [SinhVienLopTinChi].[SinhVienLopTinChi_ID]=@SinhVienLopTinChi_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@SinhVienLopTinChi_ID",SinhVienLopTinChi_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateDeleteByKeyCommand</para>
		/// <para>Input: ColumnName , ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByKeyCommand(string ColumnName,object Value){
			string strSQL="DELETE   FROM [SinhVienLopTinChi]   WHERE [SinhVienLopTinChi].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: Delete</para>
		/// <para>Input: SinhVienLopTinChiEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Delete(SinhVienLopTinChiEntity o){
			IDbCommand cmd=this.CreateDeleteCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteByID</para>
		/// <para>Input: SinhVienLopTinChi_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteByID(int SinhVienLopTinChi_ID){
			IDbCommand cmd=this.CreateDeleteByPrimaryKeyCommand(SinhVienLopTinChi_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Select join to LopTinChiSinhVien functions
		#endregion

		#region Select join to LopTinChi functions
		#endregion

		#region Select join to SinhVien functions
		#endregion

		#region Select,delete by SinhVienLopTinChi_ID functions
		#endregion

		#region Select,delete by LopTinChi_ID functions
		#endregion

		#region Select,delete by SinhVien_ID functions
		#endregion

		#region MapObject functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: MapObject</para>
		/// <para>Input: IDataReader</para>
		/// <para>Output: SinhVienLopTinChiEntity</para>
		///</summary>
		protected override SinhVienLopTinChiEntity MapObject(IDataReader r){
			SinhVienLopTinChiEntity entity = new SinhVienLopTinChiEntity();
			try{
				if(r.FieldCount>0){
					try
					{
						int ordinal = r.GetOrdinal("SinhVienLopTinChi_ID");
						if (!r.IsDBNull(ordinal)) entity.SinhVienLopTinChi_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("LopTinChi_ID");
						if (!r.IsDBNull(ordinal)) entity.LopTinChi_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("SinhVien_ID");
						if (!r.IsDBNull(ordinal)) entity.SinhVien_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("TrangThai");
						if (!r.IsDBNull(ordinal)) entity.TrangThai = ((Byte)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("NgayDangKy");
						if (!r.IsDBNull(ordinal)) entity.NgayDangKy = ((DateTime)(r.GetValue(ordinal)));
					}
					catch{}
					return entity;
				}
			}catch{}
			return null;
		}
		#endregion
	}
	/*****************************************************************************************************/
	/**********************************END SinhVienLopTinChiDAOBase*****************************************/
	/*****************************************************************************************************/
}

